import Ember from 'ember';
export default Ember.Controller.extend({
    constants: Constants,
    mainController: Ember.inject.controller('business.mainpage'),
    dateService: Ember.inject.service("date-service"),
    store: Ember.inject.service("store"),
    dataLoader: Ember.inject.service("data-loader"),
    actions: {
      dpShowAction(e){
      },
        toDetailPage(consult) {
            if (consult) {
                let id = consult.get('id');
                console.log("++++++++id++++++++++++++++**********", id);
                this.get("mainController").switchMainPage('consultation-detail', {
                    id: id,
                    editMode: "edit"
                });
            } else {
                //alert("添加");
                console.log("+++++++consult+++++++++",consult);
                this.get("mainController").switchMainPage('consultation-detail', {
                    editMode: "add",
                    id:""
                });
            }
        },
        changeBeginDateAction(date) {
            this.set("beginDate",date);
        },
        changeEndDateAction(date) {
            console.log("is true",typeof date);
            this.set("endDate",date);
        },
        //跳转回访
        jumpVist(consult){
          this.get("mainController").switchMainPage('visit-management', {
            id:consult.get("id")
          });
        },
        //咨询转预定
        jumpAdvance(consult){
          //this.set("consult",consult);
          this.get("mainController").switchMainPage('consultation-advance', {editMode:'add',
          consultId:consult.get("id")
          });
        },
    }
});
